home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Science
/
RLaB
/
examples
/
freq_plot.r
< prev
next >
Wrap
Text File
|
1994-04-26
|
548b
|
27 lines
// Example plot
t = (0:10:.05)';
x = exp (-0.5*t) .* (cos (2*pi*3*t) + sin (2*pi*7*t));
X = fft (x);
rfile faxis
freq = faxis (X, .05, 3);
mag = abs (X);
rfile angle
phase = angle (X);
pstart (1,2,"Mac");
plfont(2); // Roman font
plwid(2); // line width
ptitle ("Magnitude of FFT");
xlabel ("Frequency #gw (Hertz)"); // omega
plot ([freq,mag]);
ptitle ("Angle (tan#u-1#d(imag/real)) of FFT");
xlabel ("Frequency #gw (Hertz)");
ylabel ("Angle (radians)");
plot ([freq,phase]);
pause();
//send Postscript output to p3.ps
//plprint ("p3.ps");